import Vue from 'vue'
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

export default 
    new Router ({
        mode:'history',
        base: process.env.BASE_URL,
        routes:[
            {
                path:'/',
                name:'index',
                redirect:'/index'
            },
            {
                path: '/',
                name: 'main',
                component: () =>import(  './view/main.vue'),
                children:[
                    {
                        path: '/about',
                        name: 'about',
                        component: () =>import(  './view/about.vue'),
                    },
                    {
                        path: '/table',
                        name: 'table',
                        component: () =>import(  './view/table.vue'),
                    },
                    {
                        path: '/index',
                        name: 'index',
                        component: () =>import(  './view/index.vue'),
                    },
                    {
                        path: '/sys/userManager/list',
                        name: 'userList',
                        component: () =>import(  './view/sys/userManager/list.vue'),
                    },
                    {
                        path: '/sys/roleManager/list',
                        name: 'roleList',
                        component: () =>import(  './view/sys/roleManager/list.vue'),
                    },
                    {
                        path: '/sys/dictionaryManager/list',
                        name: 'dictionaryList',
                        component: () =>import(  './view/sys/dictionaryManager/list.vue'),
                    },
                    {
                        path: '/newsManager/list',
                        name: 'newsManagerList',
                        component: () =>import(  './view/newsManager/list.vue'),
                    },

                ]
            },
           
            {
                path: '/login',
                name: 'login',
                component: () =>import(  './view/login.vue'),
            },

        ]
    })



